#pragma once
#ifndef xType_H__
#define xType_H__

namespace NLib
{
	namespace NRoot
	{
		//TInteger
		typedef long long		Tint64;
		typedef unsigned long long Tuint64;
		typedef long			Tint32;
		typedef unsigned long	Tuint32;
		typedef short			Tint16;
		typedef unsigned short	Tuint16;
		typedef char			Tint8;
		typedef unsigned char	Tuint8;
		typedef unsigned int	Tuint;
		typedef signed   int	Tint;
		typedef char			Tachar;
		typedef Tint32			Tbool;
		typedef float			Treal32;
		typedef double			Treal64;
		//typedef long double	Treal128;
		typedef unsigned short		Twchar;
		typedef void*			Tpointer;
		typedef void			Tvoid;
	}
	namespace NType
	{//second def
		//using namespace NRoot;
	
		typedef NRoot::Tint64			TInt64;
		typedef NRoot::Tuint64			TUint64;
		typedef NRoot::Tuint32			TUint32;
		typedef NRoot::Tint32			TInt32;
		typedef NRoot::Tint				TInt;
		typedef NRoot::Tuint			TUint;
		typedef NRoot::Tuint16			TUshort;
		typedef NRoot::Tint16			TShort;
		typedef NRoot::Tuint8			TUchar;
		typedef NRoot::Tuint8			TUint8;
		typedef NRoot::Tuint16			TUint16;
		typedef NRoot::Tint8			TInt8;
		typedef NRoot::Tint16			TInt16;
#ifdef UNICODE
		typedef NRoot::Twchar			TChar;
#define skyStrlen		wcslen
#define skyStrcmp		wcscmp
#define  _XT(str)						TEXT(str)
#else
#define skyStrlen		strlen
#define skySTrCmp		strcmp
		typedef NRoot::Tint8			TChar;
#define	 _XT(str)						str
#endif
		typedef NRoot::Tbool			TBool;
		typedef NRoot::Twchar			TWchar;
		typedef NRoot::Tachar			TAchar;
		typedef NRoot::Treal32			TFloat;
		typedef NRoot::Treal64			TDouble;
		//typedef Treal128		TLdouble;

		typedef NRoot::Tuint64			TQword;
		typedef NRoot::Tuint32			TDword;
		typedef NRoot::Tuint16			TWord;
		typedef NRoot::Tuint8			TByte;

		typedef NRoot::Tpointer		    TPointer;
		typedef NRoot::Tvoid			TVoid;

		typedef NRoot::Tint32			TResult;
		typedef struct _TRect
		{
			TInt left;
			TInt top;
			TInt width;
			TInt height;
			_TRect(TInt l,TInt t,TInt w,TInt h):
			left(l),top(t),width(w),height(h){}
			_TRect(){}
		}TRect;
		typedef struct _TSize
		{
			TInt w;
			TInt h;
			_TSize(TInt W,TInt H):w(W),h(H){}
		}TSize;
	}

	namespace NValue
	{
		using namespace NType;
#define NULL  0
#define	vNull NULL
		static const TBool			VFalse		=0;
		static const TBool			VTrue		=1;
		//static const TVoid*		vNull			=0;
		//min
		static const TInt		vMinUTInt		=0;
		static const TUshort	vMinUshort		=0;
		static const TUchar		vMinUchar		=0;
		static const TByte		vMinByte		=0;
		static const TWord		vMinWord		=0;
		static const TDword		vMinDword		=0;
		static const TInt		vMinInt			=0x80000000;
		static const TShort		vMinShort		=(TShort)	0x8000;
		static const TChar		vMinChar		=(TChar)	0x80;
		static const TFloat		vMinFloat		=TFloat(1.175494351e-38F);                 ///< Constant Min Limit F32

		//max
		static const TInt		vMaxUTInt		=vMinUTInt-1;
		static const TUshort	vMaxUshort		=0xFFFF;
		static const TUchar		vMaxUchar		=0xFF;
		static const TByte		vMaxByte		=0xFF;
		static const TWord		vMaxWord		=0xFFFF;
		static const TDword		vMaxDword		=0xFFFFFFFF;
		static const TInt		vMaxInt			=0x7FFFFFFF;
		static const TShort		vMaxShort		=0x7FFF;
		static const TChar		vMaxChar		=0x7F;
		static const TFloat		vMaxFloat		=TFloat(3.402823466e+38F);                 ///< Constant Max Limit F32
		
		//const
		static const TFloat		vConFloatPi		=TFloat(3.14159265358979323846);        ///< Constant float PI
		static const TFloat		vConFloat2Pi	=TFloat(2.0 * 3.14159265358979323846);  ///< Constant float 2*PI
		static const TFloat		vConFloatEpsilon=TFloat(0.000001);                       ///< Constant float epsilon used for F32 comparisons

		static const TBool		vTrue   =  1;
		static const TBool		vFalse  =  0;
		
	}
};
using namespace NLib::NType;
using namespace NLib::NValue;


#endif // xType_H__